   <?php
   session_start();
   $ok=1;
if(isset($_SESSION['SS']))
{
 foreach($_SESSION['SS'] as $k1 => $v1)
 {
  if(isset($k1))
  {
   $ok=2;
  }
 }
}
if($ok == 2)
{

  $o = 0;
   foreach($_SESSION['SS'] as $key1=>$value1)
   {
    $str1[$o]=$key1;
	$o++;
   }
   include "dbcon.php";
   
   $querys1 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 1 ");
   $querys2 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 2 ");
   $querys3 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 3 ");
   $querys4 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 4 ");
   $querys5 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0])and dacdiem.madd = 5 ");
   $querys6 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 6 ");
   $querys7 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 7 ");
   $querys8 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 8 ");
   $querys9 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 9 ");
   $querys10 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0])and dacdiem.madd = 10 ");
   $querys11 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 11 ");
   $querys12 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 12 ");
   $querys13 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 13 ");
   $querys14 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 14 ");
   $querys15 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 15 ");
   $querys16 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 16 ");
   $querys17 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 17");
   $querys18 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 18 ");
   $querys19 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 19");
   $querys20 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 20 ");
   $querys21 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 21 ");
   $querys22 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 22 ");
   $querys23 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 23 ");
   $querys24 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 24 ");
   $querys25 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[0]) and dacdiem.madd = 25 ");
   
   $queryss1 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 1 ");
   $queryss2 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 2 ");
   $queryss3 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 3 ");
   $queryss4 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 4 ");
   $queryss5 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1])and dacdiem.madd = 5 ");
   $queryss6 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 6 ");
   $queryss7 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 7 ");
   $queryss8 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 8 ");
   $queryss9 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 9 ");
   $queryss10 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1])and dacdiem.madd = 10 ");
   $queryss11 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 11 ");
   $queryss12 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 12 ");
   $queryss13 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 13 ");
   $queryss14 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 14 ");
   $queryss15 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 15 ");
   $queryss16 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 16 ");
   $queryss17 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 17");
   $queryss18 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 18 ");
   $queryss19 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 19");
   $queryss20 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 20 ");
   $queryss21 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 21 ");
   $queryss22 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 22 ");
   $queryss23 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 23 ");
   $queryss24 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 24 ");
   $queryss25 = mysql_query("  select chitietdd.tenct from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and tskt.masp in ($str1[1]) and dacdiem.madd = 25 ");
 	$t1 = "Hãng sản xuất";
	$t2 = "Mạng";
	$t3 = "Kiểu dáng";
	$t4 = "Kích thước";
	$t5 = "Trọng lượng";
	$t6 = "Màn hình";
	$t7 = "Độ phân giải màn hình";
	$t8 = "Thông báo";
	$t9 = "Rung";
	$t10 = "Loại thẻ nhớ";
	$t11 = "Bộ nhớ trong";
	$t12 = "Tin nhắn";
	$t13 = "GPRS";
	$t14 = "EDGE";
	$t15 = "Hỗ trợ 3G";
	$t16 = "Trình duyệt";
	$t17 = "Bluetooth";
	$t18 = "Wifi";
	$t19 = "Cổng USB";
	$t20 = "Camera";
	$t21 = "Màu";
	$t22 = "Hệ điều hành";
	$t23 = "Pin";
	$t24 = "Thời gian đàm thoại";
	$t25 = "Thời gian chờ";
    
			   echo "<table align='center' border='1' style=' border-collapse: collapse ' ";
			   echo "<tr>";
			   echo "<td colspan='3' align='center'style=' padding: 5px 5px'> CHI TIẾT SẢN PHẨM </td>";
			   echo " </tr>";
			   for ($i = 1 ; $i< 26 ; $i++)
			   {
				   $t = "t$i";
				   $k = $$t;
			   echo "<tr>";
			   echo "<td align='left' width='200px' style=' padding: 5px 5px '> $k </td> ";
			   echo "<td width='300px' style=' padding: 5px 5px '>";
			   $hh = "querys$i";
			   $hhh = $$hh;
			   $gg = "queryss$i";
			   $ggg = $$gg;
    while($rows1=mysql_fetch_array($hhh))
	{
			   echo"$rows1[0]<br>";
			   
	}
   echo "</td>";
   echo "<td width='300px' style=' padding: 5px 5px '>";
		while($rows2=mysql_fetch_array($ggg))
	{
			   echo"$rows2[0]<br>";
			   
	}
	echo "</td>";	   
			   	
	echo"</tr>";
   }
	echo "</table>";
	
		
}
?>